package com.tjetc.ioc.test;

import com.tjetc.ioc.controller.UserController;
import com.tjetc.ioc.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author gaoyongxiang
 * @version v1.0
 * @date 2025/9/1
 */
public class _2TestSpring {
    public static void main1(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        System.out.println(1);
        UserService userService = context.getBean("userService", UserService.class);
        System.out.println(userService);
    }

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        UserController userController = context.getBean(UserController.class);
        userController.f();
    }


}